﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web.backStage.file
{
    public partial class updateUser : System.Web.UI.Page
    {
        int id;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["userId"] != null && Request.QueryString["userId"].Length > 0)
            {
                id = Int32.Parse(Request.QueryString["userId"]);
            }
            else
            {
                id = 2;
            }
            Dictionary<int, string> user = new Dictionary<int, string>();
            user = BLL.backStage.UserManage.getUserById(id);
            TextBox1.Text = user[1];
            TextBox2.Text = user[2];
            DropDownList1.SelectedValue = user[3];
            TextBox3.Text = user[4];
            TextBox4.Text = user[5];
            TextBox5.Text = user[6];
            TextBox6.Text = user[7];
            TextBox7.Text = user[8];
            TextBox8.Text = user[9];
            TextBox9.Text = user[10];
            TextBox10.Text = user[11];
            TextBox11.Text = user[12];
            TextBox12.Text = user[13];
            TextBox13.Text = user[14];
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Dictionary<int, string> user = new Dictionary<int, string>();
            int i = 0;
            user.Add(i++, TextBox1.Text);
            user.Add(i++, TextBox2.Text);
            user.Add(i++, DropDownList1.SelectedValue);
            user.Add(i++, TextBox3.Text);
            user.Add(i++, TextBox4.Text);
            user.Add(i++, TextBox5.Text);
            user.Add(i++, TextBox6.Text);
            user.Add(i++, TextBox7.Text);
            user.Add(i++, TextBox8.Text);
            user.Add(i++, TextBox9.Text);
            user.Add(i++, TextBox10.Text);
            user.Add(i++, TextBox11.Text);
            user.Add(i++, TextBox12.Text);
            user.Add(i++, TextBox13.Text);
            Boolean flag = BLL.backStage.UserManage.updUser(id,user);
        }
    }
}